package com.bookmanager.www.service;

import com.bookmanager.www.common.DTO.AdvancedSearchDTO;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: 风离
 * @Date: 2021/10/07/14:02
 * @Description:
 */
public interface SearchService {

    /**
     * 将数据库中数据批量放入Es中
     * @return
     */
    Boolean insertBatchBooksIntoES() throws Exception;

    /**
     * 实现ES分页查询并展示
     * @param keyWords
     * @param pageSize
     * @param pageNo
     * @return
     */
    List<Map<String,Object>> searchBooks(Integer searchType,String keyWords, int pageSize, int pageNo) throws IOException;

    /**
     * 将订单放入ES中
     * @param bookList
     * @return
     */
    Boolean insertBookList(List<Object> bookList) throws IOException;

    /**
     * 在ES中查找订单信息
     * @param orderId
     * @return
     */
    List<Map<String, Object>> searchOrders(String orderId) throws IOException;

    /**
     * ES高级查询
     * @param advancedSearchDTO
     * @return
     */
    List<Map<String, Object>> advancedSearch(AdvancedSearchDTO advancedSearchDTO) throws IOException;
}
